﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace HRM.BO
{
    public class Users
    {
        int _ID;
        public int ID
        {
            get { return _ID; }
            set { _ID=value ; }
        }

        string _ContactName;
        public string ContactName
        {
            get { return _ContactName; }
            set { _ContactName = value; }
        }
        string _LoginName;
        public string LoginName
        {
            get { return _LoginName; }
            set { _LoginName=value; }
        }

        string _LoginPassword;
        public string LoginPassword
        {
            get { return _LoginPassword; }
            set { _LoginPassword=value; }
        }

        string _EmailID;
        public string EmailID
        {
            get { return _EmailID; }
            set { _EmailID=value; }
        }
       
        int _RoleID;
        public int RoleID
        {
            get { return _RoleID; }
            set { _RoleID=value; }
        }

        bool _IsEmailVarified;
        public bool IsEmailVarified
        {
            get { return IsEmailVarified; }
            set { IsEmailVarified=value; }
        }

        bool _IsActive;
        public bool IsActive
        {
            get { return _IsActive; }
            set { _IsActive=value; }
        }

        DateTime _DateTimeCreated;
        public DateTime DateTimeCreated
        {
            get { return _DateTimeCreated; }
            set { _DateTimeCreated = value; }
        }

        DateTime _DateTimeLastUpdated;
        public DateTime DateTimeLastUpdated
        {
            get { return _DateTimeLastUpdated; }
            set { _DateTimeLastUpdated = value; }
        }

        int _LastUpdatedBy;
        public int LastUpdatedBy
        {
            get { return _LastUpdatedBy; }
            set { _LastUpdatedBy=value  ; }
        }

        public Users()
        { }

        public Users(DataRow dr)
        {
            if (dr["ID"] != DBNull.Value)
            {
                this._ID = Int32.Parse(dr["ID"].ToString());
            }

            if (dr["LoginName"] != DBNull.Value)
            {
                this._LoginName = dr["LoginName"].ToString();
            }
            if (dr["LoginPassword"] != DBNull.Value)
            {
                this._LoginPassword = dr["LoginPassword"].ToString();
            }

            if (dr["EmailID"] != DBNull.Value)
            {
                this._EmailID = dr["EmailID"].ToString();
            }

            if (dr["RoleID"] != DBNull.Value)
            {
                this._RoleID = Convert.ToInt32(dr["RoleID"].ToString());
            }

            if (dr["IsEmailVarified"] != DBNull.Value)
            {
                this._IsEmailVarified = Convert.ToBoolean(dr["IsEmailVarified"].ToString());
            }

            if (dr["IsActive"] != DBNull.Value)
            {
                this._IsActive = Convert.ToBoolean(dr["IsActive"].ToString());
            }

            if (dr["DateTimeCreated"] != DBNull.Value)
            {
                this._DateTimeCreated = Convert.ToDateTime(dr["DateTimeCreated"].ToString());
            }
            if (dr["DateTimeLastUpdated"] != DBNull.Value)
            {
                this._DateTimeLastUpdated = Convert.ToDateTime(dr["DateTimeLastUpdated"].ToString());
            }

            if (dr["LastUpdatedBy"] != DBNull.Value)
            {
                this._LastUpdatedBy = Convert.ToInt32(dr["LastUpdatedBy"].ToString());
            }
        }

        
    }
}
